import 'kb_bytedance_attribution_platform_interface.dart';

class KbBytedanceAttribution {
  Future<String?> getPlatformVersion() {
    return KbBytedanceAttributionPlatform.instance.getPlatformVersion();
  }

  ///===============安卓方法

  static Future<void> convertInit() {
    return KbBytedanceAttributionPlatform.instance.convertInit();
  }

  static Future<void> sendLaunchEvent() {
    return KbBytedanceAttributionPlatform.instance.sendLaunchEvent();
  }

  static Future<void> onEventV3(
      {required String eventName,
      required Map<String, dynamic> extraParams}) async {
    return KbBytedanceAttributionPlatform.instance.onEventV3(
      eventName: eventName,
      extraParams: extraParams,
    );
  }

  static Future<void> onEventRegister(
      {required String registerMethod, required bool isSuccess}) async {
    return KbBytedanceAttributionPlatform.instance.onEventRegister(
      registerMethod: registerMethod,
      isSuccess: isSuccess,
    );
  }

  static Future<void> onEventPurchase({
    required String contentType,
    required String contentName,
    required String contentId,
    required int contentNumber,
    required String paymentChannel,
    required String currency,
    required bool isSuccess,
    required int currencyAmount,
  }) {
    return KbBytedanceAttributionPlatform.instance.onEventPurchase(
      contentType: contentType,
      contentName: contentName,
      contentId: contentId,
      contentNumber: contentNumber,
      paymentChannel: paymentChannel,
      currency: currency,
      isSuccess: isSuccess,
      currencyAmount: currencyAmount,
    );
  }

  ///===============安卓方法

  ///===============iOS方法
  static Future<void> iOSRegisterWithOptionalData({
    String? userUniqueId,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSRegisterWithOptionalData();
  }

  static Future<void> iOSEventRegister({
    Map<String, dynamic>? params,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSEventRegister(params: params);
  }

  static Future<void> iOSEventStayTime({
    Map<String, dynamic>? params,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSEventStayTime(params: params);
  }

  static Future<void> iOSEventPurchase({
    Map<String, dynamic>? params,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSEventPurchase(params: params);
  }

  static Future<void> iOSEventGameAddiction({
    Map<String, dynamic>? params,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSEventGameAddiction(params: params);
  }

  static Future<void> iOSEventCustom({
    required String eventName,
    Map<String, dynamic>? params,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSEventCustom(eventName: eventName, params: params);
  }

  static Future<void> iOSEnableIdfa({
    required bool enable,
  }) {
    return KbBytedanceAttributionPlatform.instance
        .iOSEnableIdfa(enable: enable);
  }

  static Future<String?> iOSGetClickId() {
    return KbBytedanceAttributionPlatform.instance.iOSGetClickId();
  }
}
